﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Insert title here</title>
	<link type="text/css" rel="stylesheet" href="css/style.css">
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">
		function update() {
			var productID = ${product.productID};
			window.location.href = '${pageContext.request.contextPath}/product/updateView?productID='+productID;
		}
		function deleteUser(){
			var productID = ${product.productID};
			window.location.href = '${pageContext.request.contextPath}/product/delete?productID=' + productID;
		}
	</script>
</head>
<body>
<c:if test="${not empty product}">
	<div class="main">
		<div class="optitle clearfix">
			<div class="title">
				<h2>商品管理&gt;&gt;</h2>
			</div>
		</div>
		<div class="content">
			<table class="box">
				<tbody>
				<tr>
					<td class="field">商品编号：</td>
					<td>${product.productID}<input type="hidden" id="customerID" value="${product.productID}"></td>
				</tr>
				<tr>
					<td class="field">商品名称：</td>
					<td>${product.productName}</td>
				</tr>
				<tr>
					<td class="field">商品类别：</td>
					<td>${product.category}</td>
				</tr>
				<tr>
					<td class="field">供应商名称：</td>
					<td>${product.supplier}</td>
				</tr>
				<tr>
					<td class="field">商品单价：</td>
					<td>${product.unitPrice}</td>
				</tr>
				<tr>
					<td class="field">商品库存：</td>
					<td>${product.currentStock}</td>
				</tr>
				<tr>
					<td class="field">商品条码：</td>
					<td>${product.barcode}</td>
				</tr>
				</tbody>
			</table>
		</div>
		<div class="buttons">
			<input type="button" id="update" value="修改" class="input-button" onclick="update()">
			<input type="button" id="del" value="删除" class="input-button" onclick="deleteUser()">
			<input type="button" id="backButton" onclick="history.back(-1)" value="返回" class="input-button">
		</div>
	</div>
</c:if>
<script type="text/javascript" src="../js/user/view.js"></script>
</body>
</html>